package com.hz.module.system.dal.mysql.check.list;

import java.util.*;

import com.hz.framework.common.pojo.PageResult;
import com.hz.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.hz.framework.mybatis.core.mapper.BaseMapperX;
import com.hz.module.system.dal.dataobject.check.list.CheckListDO;
import org.apache.ibatis.annotations.Mapper;
import com.hz.module.system.controller.admin.check.list.vo.*;

/**
 * 基础检查 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CheckListMapper extends BaseMapperX<CheckListDO> {

    default PageResult<CheckListDO> selectPage(CheckListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CheckListDO>()
                .likeIfPresent(CheckListDO::getCheckListName, reqVO.getCheckListName())
                .eqIfPresent(CheckListDO::getCheckListIndustry, reqVO.getCheckListIndustry())
                .eqIfPresent(CheckListDO::getSequence, reqVO.getSequence())
                .eqIfPresent(CheckListDO::getState, reqVO.getState())
                .eqIfPresent(CheckListDO::getCheckType, reqVO.getCheckType())
                .eqIfPresent(CheckListDO::getCheckObject, reqVO.getCheckObject())
                .eqIfPresent(CheckListDO::getCheckObjectType, reqVO.getCheckObjectType())
                .betweenIfPresent(CheckListDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CheckListDO::getCheckFlag, reqVO.getCheckFlag())
                .orderByDesc(CheckListDO::getId));
    }

}